import axios from '@/axios'

// 获取角色列表
export const getRoleListAPI = (page) => {
  return axios.get(`/admin/role/${page}`)
}

// 增加角色
export const addRoleListAPI = (data) => {
  return axios.post('/admin/role', data)
}

// 修改角色
export const updateRoleListAPI = (id, data) => {
  return axios.post(`/admin/role/${id}`, data)
}

// 删除公告
export const deleteRoleListAPI = (id) => {
  return axios.post(`/admin/role/${id}/delete`)
}

// 修改角色权限状态
export const updateRoleStatusAPI = (id, status) => {
  return axios.post(`/admin/role/${id}/update_status`, {
    status,
  })
}

// 配置角色权限
export const setRoleRulesAPI = (id, rule_ids) => {
  return axios.post(`/admin/role/set_rules`, {
    id,
    rule_ids,
  })
}
